﻿<template>
  <div>
    <h3>Inject 孙子组件</h3>
    <p>消息：{{ message }}</p>
    <p>用户名：{{ user.name }}</p>
  </div>
</template>

<script>
export default {
  inject: {
    message: {
      from: 'message',
      default: '默认消息'
    },
    user: {
      from: 'userInfo',
      default: () => ({ name: '默认用户名' })
    }
  }
}
</script>
